package com.dk.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("user")
public class UserController {
    private Logger logger = LoggerFactory.getLogger(UserController.class);
    @Value("${user.uname}")
    private String uname;
    @Value("${user.uid}")
    private Integer uid;

    @RequestMapping("test")
    @ResponseBody
    public String test(){
        logger.debug("debug日志已打印,{}",uname);
        logger.info("info日志已打印++++++++++++++++,{}",uname);
        logger.warn("warn日志已打印+++++++++++,{},{}",uname,uid);
        logger.error("error日志已打印+++++++++,{}",uname);
        System.out.println("已运行");
        System.out.println(uname + "+++++++++++++" + uid);
        return "已运行";
    }
}
